#include<iostream>
using namespace std;
int main()
{
	int number;
	int m, k;
	cin >> number >> m >> k;
	int n = number;
	int pos = m - 1;
	int count = 1;
	int arr[1000];
	for (int i = 0; i < n; i++)
	{
		arr[i] = i + 1;
	}
	/*while (number > 1)
	{
		if(count==k)
		{
			if (arr[pos] != 0)
			{
				arr[pos] = 0;
				number--;
				count = 0;
				pos = (++pos) % n;
			}
			else {
				count++;
				pos = (++pos) % n;
			}
		}
		else
		{
			pos = (++pos) % n;
		}
	}*/
	while (number > 1)
	{
		if (arr[pos] != 0) {
			if (count == k)
			{
				number--;
				arr[pos] = 0;
				count = 1;
				pos = (++pos) % n;
			}
			else {
				count++;
				pos = (++pos) % n;
			}
		}
		else {
			pos = (++pos) % n;
		}
	}
	for (int i = 0; i < n; i++) {
		if (arr[i] != 0)
		{
			cout << arr[i] << endl;
		}
	}
	return 0;
}